<html>
<head><meta charset="utf-8"><title>Fix for ICE #58638 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html">Fix for ICE #58638</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="159183996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159183996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159183996">(Feb 22 2019 at 19:28)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/58654" target="_blank" title="https://github.com/rust-lang/rust/pull/58654">https://github.com/rust-lang/rust/pull/58654</a> if anyone with r+ powers sees this before <span class="user-mention" data-user-id="124288">@oli</span> please do so in order to quickly unblock him to research <a href="https://github.com/rust-lang/rust/issues/58634" target="_blank" title="https://github.com/rust-lang/rust/issues/58634">https://github.com/rust-lang/rust/issues/58634</a></p>



<a name="159184368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159184368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159184368">(Feb 22 2019 at 19:32)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> to clarify, this PR isn't aiming to do the <em>right</em> thing per se, just to avoid an underflow?</p>



<a name="159184384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159184384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159184384">(Feb 22 2019 at 19:32)</a>:</h4>
<p>cause it's not obviously right to me :)</p>



<a name="159184937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159184937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159184937">(Feb 22 2019 at 19:39)</a>:</h4>
<p>It's only to stop the ICE from happening. The proper fix will be to rework the way the "unclosed angle brackets count" is kept and reset</p>



<a name="159185039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185039">(Feb 22 2019 at 19:40)</a>:</h4>
<p>I believe the problem is because there's a reset when changing from one parse scope to another, and currently it never recovers the previous count</p>



<a name="159185110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185110">(Feb 22 2019 at 19:41)</a>:</h4>
<p>the only reason this isn't a problem with debug assertions off, is because as long as all the angle bracket count is accounted for which won't emit any errors, the count will be undeflowed and will be an arbitrarily big number</p>



<a name="159185183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185183">(Feb 22 2019 at 19:42)</a>:</h4>
<p>You could have a case where the angle bracket count is mismatched and the error suggests removing 32K opening brackets, but that would be "unlikely" to happen</p>



<a name="159185208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185208">(Feb 22 2019 at 19:43)</a>:</h4>
<p>by changing it this way, it devolves to the prior behavior of only complaining about incorrect token with no suggestions, which I believe is reasonable.</p>



<a name="159185221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185221">(Feb 22 2019 at 19:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ^</p>



<a name="159185347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185347">(Feb 22 2019 at 19:45)</a>:</h4>
<p>PL</p>



<a name="159185351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fix%20for%20ICE%20%2358638/near/159185351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fix.20for.20ICE.20.2358638.html#159185351">(Feb 22 2019 at 19:45)</a>:</h4>
<p>OK</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>